#include <stdio.h>
#include "joystick_button.h"

// callback functions
pButtonCallback joystic_Button = NULL;

void button_init() {

	DDR(BUTTON_JOYSTICK_PORT) &= ~(1 << BUTTON_JOYSTICK_PIN);

	BUTTON_JOYSTICK_PORT |= (1 << BUTTON_JOYSTICK_PIN);
	PCICR |= (1 << PCIE0);

	PCMSK0 |= (1 << BUTTON_JOYSTICK_PIN);


}


void button_set_Status_Pin(pButtonCallback callback) {
	joystic_Button = callback;
}

ISR(PCINT0_vect) {
// setpinLOW
		joystic_Button();
}
